<?php
namespace backend\services;

use backend\models\AdminUserRole;

class AdminUserRoleService extends AdminUserRole{

    protected static $_instance = null;

    /**
     *@功能:角色初始化
     *@author 梁波
     *@日期时间:2017/10/6
     */
    public function role_add($user_id)
    {
        $this->user_id=$user_id;
        $this->role_id=4;
        $this->create_user="admin";
        $this->create_date=date("Y-m-d H:i:s");
        $this->update_date=date("Y-m-d H:i:s");
        $this->update_user="admin";
        $this->save();
    }
    /**
     * @return
     */
    public static function getInstance()
    {
        if (self::$_instance === null) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
   
}
